const sql = require('mssql')

const config = {
    user: 'sa',
    password: 'GJPF4.7PTW4',
    server: 'localhost', // You can use 'localhost\\instance' to connect to named instance
    database: 'partlib',
}

(async function()  {
    try {
        // make sure that any items are correctly URL encoded in the connection string
        await sql.connect('mssql://sa:GJPF4.7PTW4@127.0.0.1/PartLib')
        const result = await sql.query`SELECT * FROM d_Part`;
        console.log(result)
    } catch (err) {
        console.log(err);
    }
})();




// const sql = require("msnodesqlv8");
 
// //const connectionString = "server=.;Database=PartLib;Trusted_Connection=Yes;Driver={SQL Server Native Client 11.0}";
// // Data Source=localhost;Initial Catalog=PartLib;User ID=sa;Password=GJPF4.7PTW4;Pooling=True;
// const connectionString = "server=.;Database=PartLib;Trusted_Connection=Yes;Driver={SQL Server Native Client 11.0}";
// const query = "SELECT * FROM d_Part";
 
// sql.query(connectionString, query, (err, rows) => {
//     console.log(rows);
// });